<template>
	<view class="success">
		<view class="box">
			<text class="text">5秒后页面自动跳转</text>
			<view class="number">{{number}}</view>
		</view>
	</view>
</template>

<script setup>
	const number = ref(5);
	const timer = setInterval(() => {
		number.value--;
		if (number.value === 0) {
			uni.reLaunch({
				url: '/pages/index/index'
			});
			clearInterval(timer);
		}
	}, 1000);
</script>

<style lang="scss" scoped>
	.success{
		width: 100%;
		height: 100vh;
		background-color: #fff;
		display: flex;
		justify-content: center;
		align-items: center;
		.box{
			width: 300rpx;
			height: 300rpx;
			background-color: #fff;
			border-radius: 20rpx;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			.text{
				font-size: 30rpx;
				color: #999;
			}
			.number{
				font-size: 60rpx;
				color: #333;
				margin-top: 20rpx;
			}
		}
	}
</style>